package com.umgsai.thread.thread16;

public class Service {
	synchronized public static void printA(){
		try {
			System.out.println(Thread.currentThread().getName() + "-" + System.currentTimeMillis() + "-进入printA");
			Thread.sleep(1000);
			System.out.println(Thread.currentThread().getName() + "-" + System.currentTimeMillis() + "-离开printA");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	synchronized public static void printB(){
		try {
			System.out.println(Thread.currentThread().getName() + "-" + System.currentTimeMillis() + "-进入printB");
			Thread.sleep(1000);
			System.out.println(Thread.currentThread().getName() + "-" + System.currentTimeMillis() + "-离开printB");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	synchronized public void printC(){
		try {
			System.out.println(Thread.currentThread().getName() + "-" + System.currentTimeMillis() + "-进入printC");
			Thread.sleep(1000);
			System.out.println(Thread.currentThread().getName() + "-" + System.currentTimeMillis() + "-离开printC");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
